package com.toaster;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;

public class ToasterActivity extends Activity /* implements View.OnClickListener */{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Spinner ageSpinner = (Spinner) findViewById(R.id.spinner1);
        ArrayAdapter adapter = ArrayAdapter.createFromResource(this, R.array.ages, android.R.layout.simple_spinner_item);
        ageSpinner.setAdapter(adapter);
        findViewById(R.id.button1).setOnClickListener(new View.OnClickListener() {
        	public void onClick(View v) {
        		String name, age, town, room, course;
        		name = ((TextView) findViewById(R.id.editText1)).getText().toString();
        		age = ageSpinner.getAdapter().getItem(ageSpinner.)
        		town = ((TextView) findViewById(R.id.editText3)).getText().toString();
        		room = ((TextView) findViewById(R.id.editText4)).getText().toString();
        		course = ((TextView) findViewById(R.id.editText5)).getText().toString();
        		String toastStr="Name    \t:"+name+"\nAge       \t:"+age+"\nTown    \t:"+town+"\nRoom    \t:"+room+"\nCourse\t:"+course;
        		Toast.makeText(getApplicationContext(), toastStr, Toast.LENGTH_SHORT).show();
        	}
        });
    }

	public void onClick(View arg0) {
		// TODO Auto-generated method stub
		
	}
}